package com.iplant.basic.service.po.mss;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.iplant.base.po.BasePO;
import com.iplant.base.po.enums.DBSchemas;
import com.iplant.base.utils.annotation.po.DBBasePO;
import com.iplant.base.utils.annotation.condition.DBCondition;
import com.iplant.base.utils.annotation.field.DBField;
import com.iplant.base.utils.annotation.join.DBJoin;

import java.io.Serializable;

@DBBasePO(TableName = "mss_materialgroup", CheckName = {"Code", "Name"})
public class MSSMaterialGroup extends BasePO implements Serializable {
    /**
     * 物料组信息
     */
    private static final long serialVersionUID = 1L;

    public MSSMaterialGroup() {
    }

    @DBField
    @DBCondition
    public int ParentGroupID;// 上级物料组ID
    @DBJoin(name = "Name", tableName = "mss_materialgroup", tableAsName = "t1", Schemas = DBSchemas.Basic,
            MainTableField = "ParentGroupID")
    @DBCondition
    public String ParentGroupName;// 上级组ID全称
    @DBJoin(name = "Code", tableName = "mss_materialgroup", tableAsName = "t1", Schemas = DBSchemas.Basic,
            MainTableField = "ParentGroupID")
    @DBCondition
    public String ParentGroupCode;

    public int ItemCount = 0;
    public int MaterialCount = 0;
    /**
     * 上级组全称
     */
    @DBField
    @DBCondition
    public String GroupFullName;

    /**
     * 组全称
     */
    @DBField
    public String FullGroupName;


    @JsonProperty("ParentGroupID")
    public int getParentGroupID() {
        return ParentGroupID;
    }

    public void setParentGroupID(int parentGroupID) {
        ParentGroupID = parentGroupID;
    }

    @JsonProperty("ParentGroupName")
    public String getParentGroupName() {
        return ParentGroupName;
    }

    public void setParentGroupName(String parentGroupName) {
        ParentGroupName = parentGroupName;
    }

    @JsonProperty("ParentGroupCode")
    public String getParentGroupCode() {
        return ParentGroupCode;
    }

    public void setParentGroupCode(String parentGroupCode) {
        ParentGroupCode = parentGroupCode;
    }

    @JsonProperty("GroupFullName")
    public String getGroupFullName() {
        return GroupFullName;
    }

    public void setGroupFullName(String groupFullName) {
        GroupFullName = groupFullName;
    }

    @JsonProperty("ItemCount")
    public int getItemCount() {
        return ItemCount;
    }

    public void setItemCount(int itemCount) {
        ItemCount = itemCount;
    }

    @JsonProperty("MaterialCount")
    public int getMaterialCount() {
        return MaterialCount;
    }

    public void setMaterialCount(int materialCount) {
        MaterialCount = materialCount;
    }

    @JsonProperty("FullGroupName")
    public String getFullGroupName() {
        FullGroupName = GroupFullName + Name +"/";
        return FullGroupName;
    }

    public void setFullGroupName(String fullGroupName) {
        FullGroupName = fullGroupName;
    }
}
